# -*- coding: UTF-8 -*-
import functions.cameraFunctions as c_tools
from multiprocessing import Process, Queue
import time


if __name__ == '__main__':
    pro = c_tools.Camera()
    rec_queue = Queue()
    img_queue = Queue()
    result_queue = Queue()
    # 进程一：打开摄像头，获取图像
    p1 = Process(target=pro.GetPicture, args=(rec_queue, img_queue, result_queue,))
    p2 = Process(target=pro.ProcessingPictures, args=(img_queue, result_queue,))
    p3 = Process(target=pro.RecordVideo, args=(rec_queue,))
    p1.start()
    p2.start()
    p3.start()
    p1.join()
    p2.terminate()
    p3.terminate()
